import 'package:flutter/material.dart';

// 参考：https://github.com/flutter/samples/blob/main/compass_app/app/lib/ui/core/themes/theme.dart
// 参考：https://juejin.cn/post/7366446446818639911

abstract final class AppColors {
  static const Color yellow = Color(0xFFFFC107);
  static const Color yellow2 = Color(0xFFFFE082);
  static const Color white = Color(0xFFFFF7FA);
  static const Color black = Color(0xFF000000);

  static const lightColorScheme = ColorScheme.light(
    primary: AppColors.black,
    onPrimary: AppColors.white,
    secondary: AppColors.yellow,
    onSecondary: AppColors.black,
    surface: AppColors.white,
    onSurface: AppColors.black,
    error: Colors.red,
    onError: Colors.white,
    secondaryContainer: yellow2,
    onSecondaryContainer: AppColors.black,
  );

  static const darkColorScheme = ColorScheme.light(
    primary: AppColors.white,
    onPrimary: AppColors.black,
    secondary: AppColors.yellow,
    onSecondary: AppColors.black,
    surface: AppColors.black,
    onSurface: AppColors.white,
    error: Colors.red,
    onError: Colors.white,

    secondaryContainer: yellow2,
    onSecondaryContainer: AppColors.black,
  );
}

final textTheme = const TextTheme(
  displayLarge: TextStyle(
    fontFamily: 'Corben',
    fontSize: 24,
    fontWeight: FontWeight.bold,
    color: AppColors.black,
  ),
  titleLarge: TextStyle(
    fontFamily: 'Corben',
    fontSize: 16,
    fontWeight: FontWeight.bold,
    color: AppColors.black,
  ),
);

abstract final class AppTheme {
  static final lightTheme = ThemeData(
    useMaterial3: true,
    colorScheme: AppColors.lightColorScheme,
    textTheme: textTheme,
  );

  static ThemeData darkTheme = ThemeData(
    colorScheme: AppColors.darkColorScheme,
    useMaterial3: true,
    textTheme: textTheme,
  );
}
